#pragma once

#include<iostream>
#include<unistd.h>
#include<fcntl.h>
#include<cstring>
#include<cerrno>

void setNonBlock(int fd)
{
    int f1 = fcntl(fd,F_GETFL);// 先获取一下文件描述符的状态
    if(f1 < 0)// 获取失败
    {
        std::cerr << "fcntl : " << strerror(errno) << std::endl;
    }
    fcntl(fd,F_SETFL,f1 | O_NONBLOCK);// F_SETFL:设置标志位
}

void printfLog()
{
    std::cout << "this is a log" << std::endl;
}

void download()
{
    std::cout << "this is a download" << std::endl;
}

void executSql()
{
    std::cout << "this is a executSql" << std::endl;
}